{{assign var="title" value="用户列表"}}
{{include file="admin/intop.html"}}
<style>
        .lr{width:100px;}
       /* td.lf input{float:left;}*/
        .ico-succ{display: none;}
</style>
{{if !$user.ID}}
<script src="res/js/jquery/jquery-migrate-1.1.1.js" type="text/javascript"></script>
<script src="res/js/base.js" type="text/javascript"></script> 
<script type="text/javascript" src="res/js/formvalidator/formValidator-4.1.3.min.js"></script>
<script type="text/javascript" src="res/js/formvalidator/formValidatorRegex.js" ></script>
<script type="text/javascript">
$(document).ready(function(){
	$.formValidator.initConfig({theme:"126",formID:"form1",mode:'AutoTip',onError:function(msg){alert(msg)},inIframe:true});
    	$("#username").formValidator({onShow:"请输入手机号码",onFocus:"手机号码必须为11位,请确认",onCorrect:"该手机号码可以注册"}).inputValidator({min:11,max:11,onError:"手机号码必须为11位,请确认"}).regexValidator({regExp:"mobile",dataType:"enum",onError:"手机的格式不正确"})
    	    .ajaxValidator({
    		dataType : "json",
    		async : true,
    		url : "index.php?{{$TIN_CTL}}=user&{{$TIN_ACT}}=chk&id={{$user.ID}}",
    		success : function(data){
                if(data.code=='success') {
                	return true;
                }else{
                	return data.msg;
                }
    		},
    		buttons: $("#submit"),
    		error: function(jqXHR, textStatus, errorThrown){alert("服务器没有返回数据，请重试"+errorThrown);},
    		onError : "该手机号码不可用，请更换手机号码",
    		onWait : "正在校验，请稍候..."
    	});

    $.formValidator.reloadAutoTip();
});
</script>
{{/if}}
<form id="form1" name="form1" method="post" action="admin.php?ctl=user&act={{$smarty.request.act}}">
<input type="hidden" name="id" value="{{$smarty.request.id}}">
<input type="hidden" name="actname" value="save">
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="table_list">
    <tr class="mouse">
    <td class="lr"><font color="red">*</font> 手机号码</td>
    <td class="lf">
            {{if $user.USERNAME}}{{$user.USERNAME}}{{else}}<input name="username" type="text" maxlength="20" id="username" value="{{$user.USERNAME}}" style="width:200px;" />{{/if}}
            <div id="usernameTip" ></div>
    </td>
    </tr>
    <tr class="mouse">
    <td class="lr"><font color="red">*</font> 设置登录密码</td>
    <td class="lf">
            <input name="password" type="password" maxlength="20" id="password1" value="" style="width:200px;" />
            <div id="password1Tip" ></div>
    </td>
    </tr>
    <tr class="mouse">
    <td class="lr"><font color="red">*</font> 确认登录密码</td>
    <td class="lf">
            <input name="password_confirm" type="password" maxlength="20" id="password2" value="" style="width:200px;" />
            <div id="password2Tip" ></div>
    </td>
    </tr>
    <tr class="mouse">
    <td class="lr"><font color="red">*</font> 状态</td>
    <td class="lf">
        <input type="radio" name="state" id="state1" value="1"{{if $user.STATE=="" || $user.STATE==1}} checked="checked"{{/if}}/><label for="state1">启用</label>
        <input type="radio" name="state" id="state2" value="2"{{if $user.STATE==2}} checked="checked"{{/if}}/><label for="state2">禁用</label></td>
    </tr>
    <tr class="mouse">
    <td class="lr"><font color="red">*</font> 等级</td>
    <td class="lf">
        <select name="usertype_id" id="usertype_id" style="float:left;">
            {{foreach from=$userType item=li}}
            <option value="{{$li.ID}}"{{if $user.USERTYPE_ID == $li.ID}} selected{{/if}}>{{$li.TYPE_NAME}}</option>
            {{/foreach}}
        </select>
        <div id="usertype_idTip" ></div>
    </td>
    </tr>
    <tr class="bottom">
    <td colspan="2" align="center"><input type="submit" name="btnSubmit" id="btnSubmit" value="确认保存" /></td>
    </tr>
</table>
</form>
{{include file="admin/infoot.html"}}
